# 实现一个用于登记用户账号信息的界面（如果是带 * 号的必填项，要求一定要有输入并且不能是空格）


import easygui as g


def user_login():
    g.msgbox("欢迎进入用户账号信息界面^_^")
    msg = "请填写以下联系方式"
    title = "账号安全中心"
    input_option = [" *用户名", " *真实姓名", " 固定电话", " *手机号码", " QQ", " email"]
    login_info = g.multenterbox(msg, title, input_option)

    while True:
        if login_info is None:
            break
        errmsg = ""
        for i in range(len(input_option)):
            option = input_option[i].strip()
            if login_info[i].strip() == "" and option[0] == "*":
                errmsg += ('[%s]为必填项 \n\n' % option)
        if errmsg == "":
            break
        login_info = g.multenterbox(errmsg, title, input_option, login_info)
    print("用户填写信息如下：%s" % str(login_info))


if __name__ == "__main__":
    user_login()